import request from '@/utils/request'

// 获取房产列表
export function gethouser(params) {
  return request({
    url: `/properties`,
    method: 'get',
    params
  })
}
// 获取分类
export function classify() {
  return request({
    url: `/categories`,
    method: `get`
  })
}
// 获取经纪列表
export function getbroker() {
  return request({
    url: '/agents',
    method: 'GET'
  })
}
// 搜索
export function search(params) {
  // console.log(666, params)
  return request({
    // url: `/properties/count?_limit=${params._limit}&_start=${params._start}&title_contains=${params.title_contains}&agent=${params.agent}&category=${params.category}`,
    url: `/properties`,
    method: 'get',
    params: params
  })
}
export function addbroker(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}
// 删除房产
export function delrouser(id) {
  return request({
    url: `/properties/${id}`,
    method: 'DELETE'

  })
}
// 获取指定房产
export function getedithouser(id) {
  return request({
    url: `/properties/${id}`,
    method: `get`
  })
}
// 获取房产数量
export function getotal() {
  return request({
    url: `/properties/count`,
    method: 'get'
  })
}
// 编辑房产
export function edithouser(data) {
  // console.log(data, 65)
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}
// 地图
